<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            /* 给父级添加perspective */
            perspective: 1000px;
            /* 模拟的眼睛到电脑屏幕的距离 */
        }
          .box{
            width: 200px;
            height: 200px;
            margin: 50px auto;
            background-color: pink;
        }
        .box:hover{
            /* z轴方向 正值往你眼睛方向  实际盒子大小不变*/
            transform: translateZ(100px);
        }

    </style>
</head>
<body>
    <div class="box"></div>   
</body>
</html>